package com.duan.filter;

import javax.servlet.*;
import javax.servlet.annotation.WebFilter;
import java.io.IOException;

/**
 * @author db
 * @version 1.0
 * @description LoginFilter
 * @since 2023/12/19
 */

//@WebFilter(urlPatterns = "/*")
public class LoginFilter implements Filter {

    // 拦截方法，只要资源请求被拦截到，就一定会调用此方法
    @Override
    public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException {
        System.out.println("拦截方法执行,拦截了请求");

        System.out.println("放行前逻辑+++++++");
        chain.doFilter(request,response);

        System.out.println("放行后逻辑——————");
    }
}
